package com.twoGroup.boot.service;


import com.twoGroup.boot.pojo.GoodsAndShopAndGoodsTypeAndGoodsBrand;
import com.twoGroup.boot.pojo.Page;
import com.twoGroup.boot.pojo.ShopAndUser;
import com.twoGroup.boot.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

//管理员对用户的增删改查
@Service
public interface AdminService {
    public String adminAddUser(String nickname, String sex, int age, String password, String telephone, String email, String address, String idCard, String rName);
    public String adminDeleteUser(int userId);
    public int adminDeleteUsers(Integer[] userIds);
    String adminUpdateUser(int UserId, String nickname, String sex, String telephone, String rName);    public List<User> adminQueryUser(int userId);
    //管理员对商家的增删改查
        public String adminAddShopper(String nickname, String sex, int age, String password, String telephone, String email, String address, String idCard, String rName);
        public String adminDeleteShopper(int userId);
        public int adminDeleteShoppers(Integer[] userIds);
        public String adminUpdateShopper(int userId, String nickname, String sex, int age, String password, String telephone, String email, String address, String idCard, String rName);
        public List<User> adminQueryShopper(int userId);


//管理员对商品的增删改查
    public String adminDeleteGoods(int goodsId);
    public int adminDeleteMoreGoods(Integer[] goodsIds);
   // public List<GoodsAndShopAndGoodsTypeAndGoodsBrand> adminQueryGoods(int goodsId);
//    管理员对店铺的增删改查
    public String adminDeleteShop(int shopId);
    public int adminDeleteShops(Integer[] shopIds);
//    public List<ShopAndUser> adminQueryShop(int shopId);
//管理员批准用户是否成为商家
    public int agreeUserToBeShopper(int userId);
    public int disagreeUserToBeShopper(int userId);
//    管理员批准商品是否上架
    public int agreeGoodsToBePutOnSale(int goodsId);
    public int disagreeGoodsToBePutOnSale(int goodsId);

//管理员对用户是、商家、商品、店铺的模糊查询
    public List<User> likeUserByNickName(String nickName);
    public List<User> likeShopperByNickName(String nickName);
    public List<GoodsAndShopAndGoodsTypeAndGoodsBrand> likeGoods(String goodsName);
    public List<ShopAndUser> likeShop(String shopName);
    /**
     * 模糊查询申请成为商家的用户、申请上架的商品
     *
     */
    public List<User> likeAllUserToBeShopper(String nickName);
    public List<GoodsAndShopAndGoodsTypeAndGoodsBrand> likeAllGoodsToBePutOnSale(String goodsName);
//    查询每个表中的信息
    public List<User> FindAllUser();
    public List<User> FindAllShopper();
    public List<ShopAndUser> FindAllShop();
    public List<GoodsAndShopAndGoodsTypeAndGoodsBrand> FindAllGoods();

    public List<User> FindAllUserToBeShopper();
    public List<GoodsAndShopAndGoodsTypeAndGoodsBrand> FindAllGoodsToBePutOnSale();
//  分页的相关操作

    /**
     *用户
     */
    Page<User> selectUserByPage(int pageNow, int pageSize);
    Page<User> likeUserByPage(int pageNow, int pageSize, String nickName);

    /**
     *商家
     */
    Page<User> selectShopperByPage(int pageNow, int pageSize);
    Page<User> likeShopperByPage(int pageNow, int pageSize, String nickName);

    /**
     *商品
     */
    Page<GoodsAndShopAndGoodsTypeAndGoodsBrand> selectGoodsByPage(int pageNow, int pageSize);
    Page<GoodsAndShopAndGoodsTypeAndGoodsBrand> likeGoodsByPage(int pageNow, int pageSize, String goodsName);

    /**
     *店铺
     */
    Page<ShopAndUser> selectShopByPage(int pageNow, int pageSize);
    Page<ShopAndUser> likeShopByPage(int pageNow, int pageSize, String shopName);

    /**
     * 用户申请成为商家管理
     */
    Page<User> selectUserToBeShopperByPage(int pageNow, int pageSize);
    Page<User> likeUserToBeShopperByPage(int pageNow, int pageSize, String nickName);

    /**
     *商品申请上架管理
     */
    Page<GoodsAndShopAndGoodsTypeAndGoodsBrand> selectGoodsToBePutOnSaleByPage(int pageNow, int pageSize);
    Page<GoodsAndShopAndGoodsTypeAndGoodsBrand> likeGoodsToBePutOnSaleByPage(int pageNow, int pageSize, String goodsName);

    /**
     *查重操作
     */
    public int checkNicknameIsSingle(String nickname);
    public int checkTelephoneIsSingle(String telephone);
    public int checkEmailIsSingle(String email);

    /**
     * 判断删除对象是否存在并返回信息
     */
    public int checkUserIdIsPresent(int userId);
    public int checkShopIdIsPresent(int shopId);
    public int checkGoodsIdIsPresent(int goodsId);

    /**
     * 批量删除
     */
//    public int deleteManyUser(Integer[] userIds);
}
